<extend name="public@base5"/>
<block name="main">
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link active" href="{:url('Theme/index')}">{:lang('ADMIN_THEME_INDEX')}</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="{:url('Theme/install')}">{:lang('ADMIN_THEME_INSTALL')}</a>
            </li>
        </ul>
        <form method="post" class="js-ajax-form margin-top-20">
            <php> $status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN'));</php>
            <table class="table table-hover table-bordered table-list">
                <thead>
                <tr>
                    <th>{:lang('Key')}</th>
                    <th>{:lang('Name')}</th>
                    <th>{:lang('Version')}</th>
                    <th>{:lang('Language')}</th>
                    <th>{:lang('Author')}</th>
                    <th>{:lang('Description')}</th>
                    <th width="180">{:lang('ACTIONS')}</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="themes" item="vo">
                    <tr>
                        <td>
                            {$vo.theme}
                            <eq name="vo.theme" value="$default_theme">
                                <span class="badge text-bg-success">{:lang('Enabled')}</span>
                            </eq>
                        </td>
                        <td>{$vo.name}</td>
                        <td><span class="badge text-bg-success">{$vo.version}</span></td>
                        <td>{$vo.lang}</td>
                        <td>{$vo.author}</td>
                        <td>{$vo.description}</td>
                        <td>
                            <a class="btn btn-xs btn-info" target="_blank"
                               href="{:url('Theme/design',['theme'=>$vo.theme])}"
                               title="{:lang('Design')}" data-toggle="tooltip">
                                <i class="fa fa-paint-brush fa-fw"></i>
                            </a>
                            <a class="btn btn-xs btn-primary"
                               href="javascript:parent.openIframeLayer('{:url('Theme/files',array('theme'=>$vo['theme']))}','{$vo.name}{:lang('File List')}',{});"
                               title="{:lang('File List')}" data-toggle="tooltip">
                                <i class="fa fa-list fa-fw"></i>
                            </a>
                            <a class="btn btn-xs btn-success js-ajax-dialog-btn"
                               href="javascript:"
                               data-method="put"
                               data-href="admin/themes/{$vo.theme}"
                               data-msg="{:lang('UPDATE_THEME_CONFIRM_MSG')}"
                               title="{:lang('Update')}" data-toggle="tooltip">
                                <i class="fa fa-refresh fa-fw"></i>
                            </a>
                            <if condition="$vo.theme == $default_theme">
                            <span class="btn btn-xs btn-success disabled" color="#cccccc"
                                  title="{:lang('Enable')}" data-toggle="tooltip">
                                <i class="fa fa-toggle-on fa-fw"></i>
                            </span>
                                <else/>
                                <a class="btn btn-xs btn-success js-ajax-dialog-btn"
                                   href="javascript:"
                                   data-href="admin/themes/{$vo.theme}/active"
                                   data-msg="{:lang('ENABLE_THEME_CONFIRM_MSG')}"
                                   title="{:lang('Enable')}" data-toggle="tooltip">
                                    <i class="fa fa-toggle-on fa-fw"></i>
                                </a>
                            </if>

                            <if condition="($vo.name == 'simpleboot3') OR ($vo.theme == $default_theme) ">
                            <span class="btn btn-xs btn-danger disabled"
                                  title="{:lang('Uninstall')}" data-toggle="tooltip">
                                <i class="fa fa-trash fa-fw"></i>
                            </span>
                                <else/>
                                <a class="btn btn-xs btn-danger js-ajax-delete"
                                   href="javascript:"
                                   data-href="admin/themes/{$vo.theme}"
                                   data-msg="{:lang('UNINSTALL_THEME_CONFIRM_MSG')}"
                                   title="{:lang('Uninstall')}" data-toggle="tooltip">
                                    <i class="fa fa-trash fa-fw"></i>
                                </a>
                            </if>

                        </td>
                    </tr>
                </foreach>
                </tbody>
                <tfoot>
                <tr>
                    <th>{:lang('Key')}</th>
                    <th>{:lang('Name')}</th>
                    <th>{:lang('Version')}</th>
                    <th>{:lang('Language')}</th>
                    <th>{:lang('Author')}</th>
                    <th>{:lang('Description')}</th>
                    <th>{:lang('ACTIONS')}</th>
                </tr>
                </tfoot>
            </table>
        </form>
    </div>
</block>